{% load i18n sizeformat %}
{% load url from future %}
<h3>{% trans "Job Overview" %}</h3>
<div class="status row detail">
  <dl class="dl-horizontal">
    <dt>{% trans "Status" %}</dt>
    <dd>{{ job_execution.info.status }}</dd>
    <dt>{% trans "ID" %}</dt>
    <dd>{{ job_execution.id }}</dd>
    <dt>{% trans "Job Template" %}</dt>
    <dd><a href="{% url 'horizon:project:data_processing.jobs:details' job_execution.job_id %}">{{ object_names.job_name }}</a></dd>
    {% if job_execution.input_id %}
      <dt>{% trans "Input Data Source" %}</dt>
      <dd><a href="{% url 'horizon:project:data_processing.data_sources:details' job_execution.input_id %}">{{ object_names.input_name }}</a> ({{ object_names.input_url }})</dd>
    {% endif %}
    {% if job_execution.output_id %}
      <dt>{% trans "Output Data Source" %}</dt>
      <dd><a href="{% url 'horizon:project:data_processing.data_sources:details' job_execution.output_id %}">{{ object_names.output_name }}</a> ({{ object_names.output_url }})</dd>
    {% endif %}
    <dt>{% trans "Cluster" %}</dt>
    <dd><a href="{% url 'horizon:project:data_processing.clusters:details' job_execution.cluster_id %}">{{ object_names.cluster_name }}</a></dd>
    <dt>{% trans "Last Updated" %}</dt>
    <dd>{{ job_execution.updated_at }}</dd>
    <dt>{% trans "Started" context "Start time" %}</dt>
    <dd>{{ job_execution.start_time }}</dd>
    <dt>{% trans "Ended" context "End time" %}</dt>
    <dd>{{ job_execution.end_time }}</dd>
    <dt>{% trans "Return Code" %}</dt>
    <dd>{{ job_execution.return_code }}</dd>
    <dt>{% trans "Oozie Job ID" %}</dt>
    <dd>{{ job_execution.oozie_job_id }}</dd>
    <dt>{% trans "Created" context "Created time" %}</dt>
    <dd>{{ job_execution.created_at }}</dd>
    <dt>{% trans "Job Configuration" %}</dt>
    <dd>{% for group, vals in job_execution.job_configs.iteritems %}
        <ul><li><span style="font-weight:bold">{% blocktrans %}{{ group }}:{% endblocktrans %}</span>
          {% if group == "args" %}
            <ul>{% for val in vals %} <li>{{ val }}</li> {% endfor %}</ul>
          {% else %}
            <ul>{% for key, val in vals.iteritems %} <li>{{ key }} = {{ val }}</li> {% endfor %}</ul>
          {% endif %}
        </li></ul>
        {% endfor %}
    </dd>
  </dl>
</div>
